using System;
using System.Buffers;
using NPOI.SS.Formula.Functions;
using SuperSocket.ProtoBase;

namespace MSocketCore.MSocket
{
    public class MyPackageFilter : PipelineFilterBase<MyPackage>
    {
        public override MyPackage Filter(ref SequenceReader<byte> reader)
        {
            var pack = reader.Sequence.Slice(0, reader.Length);
            try
            {
                var ret = DecodePackage(ref pack);
                return ret;
            }
            finally
            {
                reader.Advance(reader.Length);
            }
        }
    }
}